package com.baimawangzi.recovery.servlet.integral;

import com.baimawangzi.recovery.bean.Integral;
import com.baimawangzi.recovery.service.impl.IntegralServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/integralfindbyid.do")
public class IntegralFindByIdServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        IntegralServiceImpl integralService = new IntegralServiceImpl();
        //解析url参数
        int id = Integer.parseInt(req.getParameter("id"));
        Integral integral = integralService.findById(id);
        System.out.println(integral+"111111111111111111");
        req.setAttribute("integral",integral);
        req.getRequestDispatcher("integral_update.jsp").forward(req,resp);
    }
}
